# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

DESCRIPTION="Streaming solution for DVB(-S/-S2/-C/-T) cards, reading streams from
/dev/dvb/* and sending using UDP Multicast."
HOMEPAGE="http://www.dvbyell.org/"
SRC_URI="http://www.dvbyell.org/download.php/${P}.tar.bz2"

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="doc"

DEPEND=">=dev-libs/libxml2-2.6
		>=media-libs/libdvbpsi-0.1.6"
RDEPEND=${DEPEND}

src_unpack() {
	unpack ${A}
	cd ${S}
	sed -i -e "s:\/usr\/local:\${DESTDIR}usr:g" Makefile \
		   -e "s:\/etc:\${DESTDIR}etc:g" Makefile \
		   || die "sed failed to correct Makefile."
}
src_compile() {
		emake || die "emake failed."
}

src_install() {
	local docs="CHANGES README VERSION"
	dodir /usr/bin	
	make DESTDIR=${D} install || die "make install failed." 
	dodir /etc
	make DESTDIR=${D} installconf || die "make installconf failed."
	use doc && dodoc ${DOCS}

}
